Skip to content

C++ HTTP handlers - Module Bindings#5023

Merged
JasonAtClockwork merged 16 commits into
phoebe/http-handlers-webhooksfrom
jlarabie/http-handler-cpp
May 22, 2026
Merged

C++ HTTP handlers - Module Bindings#5023
JasonAtClockwork merged 16 commits into
phoebe/http-handlers-webhooksfrom
jlarabie/http-handler-cpp

Conversation

@JasonAtClockwork
Copy link
Copy Markdown
Contributor

@JasonAtClockwork JasonAtClockwork commented May 14, 2026

Description of Changes

Adding C++ HTTP handlers based on #4636

  • adds the C++ handler/router API SPACETIMEDB_HTTP_HANDLER(), SPACETIMEDB_HTTP_ROUTER()
  • wires C++ HTTP handlers into module definition/build/runtime registration
  • mirrors the Rust/TypeScript HTTP smoketests and docs coverage
  • update to the the HTTP handlers docs examples

API and ABI breaking changes

New APIs for http handler and router behind SPACETIMEDB_UNSTABLE_FEATURES and should not be breaking.

Expected complexity level and risk

3 - this touches the C++ binding surface, runtime/module registration, and the smoketest/docs paths, so there is more churn than I’d like, but it is still fairly contained to the C++ HTTP work.

Testing

  • Expanded the C++ compile-surface tests
  • Added C++ unit coverage for HTTP conversion helpers
  • Expanded crates/smoketests/tests/smoketests/http_routes.rs with C++ mirrors of the Rust HTTP
    route tests
  • Added a C++ docs-example smoketest for docs/docs/00200-core-concepts/00200-functions/00600-HTTP- handlers.md

I also did some manual testing with a throw away project

@JasonAtClockwork JasonAtClockwork self-assigned this May 14, 2026
@JasonAtClockwork JasonAtClockwork marked this pull request as ready for review May 14, 2026 22:01
@JasonAtClockwork JasonAtClockwork requested a review from rekhoff May 14, 2026 22:01
Copy link
Copy Markdown
Contributor

@rekhoff rekhoff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested these changes using some local throw-away test projects, and everything seems to work as intended, and function like the Rust-side changes do.
I have some minor nits, but they are optional items, not critical changes.
Marking my approval, looks good to me.

Comment thread crates/bindings-cpp/include/spacetimedb/http_client_impl.h Outdated
Comment thread crates/bindings-cpp/include/spacetimedb/http_handler_macros.h Outdated
Comment thread crates/bindings-cpp/include/spacetimedb/http_client_impl.h Outdated
@JasonAtClockwork JasonAtClockwork merged commit 6307a68 into phoebe/http-handlers-webhooks May 22, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants